		
		function haveRight(_this){
			var result = $(_this).hasClass("disabled");
			return !result;
		}
		
		function checkRight(_this){
			if(haveRight(_this)){
				return true;
			}else{
				alert("没有相应权限！");
				return false;
			}
		}
		
		//添加角色授权用户
		function addRoleUser(roleId, _this){
			if(haveRight(_this)){
				var url = "../sys/userRole-userSelect.action?roleId="+roleId;
				showModalWindow(
						url,
						window,
						'resizable:no;scroll:yes;status:no;dialogWidth=300px;dialogHeight=450px;center=yes;help=no',
						function(result){
							if(result!=null&&result!='undefined'&&result!=''){
								var url = "userRole-saveRoleUsers.action";
								$.ajax({
									url: url,
									type: "post",
									data: {"roleId":roleId,"userIds":result},
									dataType: "json",
									success: function(result){
										if (result.success){
											alert("添加成功！");
											$("form")[0].submit();
										}else{
											alert("添加失败："+result.errorMessage);
										}
									}
								});
							}
						}
				);
				return true;
			}else{
				alert("没有相应权限！");
				return false;
			}
		}
		
		function resetFuncAndRoles(){
			$.ajax({
				url:"roleInfo-resetFuncAndRoles.action",
				type: "post",
				dataType:"json",
				success: function(result){
					if (result.success){
						alert("功能权限及角色权限配置已经重置！");
					}
					location.reload(true);
				}
			});
		}
